﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DCTLib.Common;
using System.Data;

namespace DCTAccess.Business.Member
{
    public class Member : User
    {
        private string _regDate;
        private string _uniqueCode;
        private int _levelInfo;

        public Member(string loginName, string originalPassword)
        {
            UserName = loginName;
            HashedPassword = MD5Helper.GetMD5Hash(originalPassword);
        }

        public Member() { }

        public Member(DataRow memberInfo)
        {
            this.ID = Convert.ToInt32(memberInfo["MemberID"].ToString());
            this.UserName = memberInfo["Username"].ToString();
            this.HashedPassword = memberInfo["HashedPassword"].ToString();
            this.FullName = memberInfo["FullName"].ToString();
            this.Mobile = memberInfo["Mobile"].ToString();
            this.Address = memberInfo["Address"].ToString();
            this.Email = memberInfo["Email"].ToString();
            this.LastLoginDate = memberInfo["LastLoginDate"].ToString();
            this.Birthday = memberInfo["Birthday"].ToString();
            this.RegDate = memberInfo["RegDate"].ToString();
            this.UniqueCode = memberInfo["UniqueCode"].ToString();
            this.LevelInfo = Convert.ToInt32(memberInfo["LevelInfo"].ToString());
        }

        #region Properties
        public int LevelInfo
        {
            get { return _levelInfo; }
            set { _levelInfo = value; }
        }

        public string UniqueCode
        {
            get { return _uniqueCode; }
            set { _uniqueCode = value; }
        }

        public string RegDate
        {
            get { return _regDate; }
            set { _regDate = value; }
        }

        public string Birthday
        {
            get { return _birthday; }
            set { _birthday = value; }
        }
        public string Address
        {
            get { return _address; }
            set { _address = value; }
        }


        public string Mobile
        {
            get { return _mobile; }
            set { _mobile = value; }
        }

        public int ID
        {
            get { return _ID; }
            set { _ID = value; }
        }

        public string UserName
        {
            get { return _userName; }
            set { _userName = value; }
        }

        public string HashedPassword
        {
            get { return _hashedPassword; }
            set { _hashedPassword = value; }
        }

        public string FullName
        {
            get { return _fullName; }
            set { _fullName = value; }
        }

        public string Email
        {
            get { return _email; }
            set { _email = value; }
        }

        public string LastLoginDate
        {
            get { return _lastLoginDate; }
            set { _lastLoginDate = value; }
        }

        public bool Disable
        {
            get { return _disable; }
            set { _disable = value; }
        }
        #endregion 
    }
}
